<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>划转</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="screen-orientation" content="portrait">
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="x5-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="x5-page-mode" content="app">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!-- css -->
    <link href="/zc/css/mui.min.css" rel="stylesheet">
    <link href="/zc/css/login.css" rel="stylesheet">
    <link href="/zc/css/base.css" rel="stylesheet">
    <link href="/zc/css/mobileSelect.css" rel="stylesheet" />
    <!-- js -->
    <script src="/zc/js/jquery.min.js"></script>
    <script src="/zc/js/mui.min.js"></script>
    <script src="/zc/js/template.js"></script>
    <script src="/zc/js/flexible.js"></script>
    <script src="/zc/js/flexible_css.js"></script>
    <script src="/zc/js/foot_bar.js"></script>
    <script src="/zc/js/mobileSelect.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        mui.init();
    </script>
    <style>
        #app {
            margin-top:
        }

        .ws_small {
            width: 92%;
            margin: auto;
            margin-top: .4rem;
            font-size: .4rem;
        }

        :-ms-input-placeholder {
            color: #D9D9D9
        }

        ::-webkit-input-placeholder {
            color: #D9D9D9
        }

        input {
            width: 100%;
            height: 1.013333rem;
            font-size: .346667rem;
            border: 1px solid #D9D9D9;
            border-radius: 3px
        }

        #upload_file {
            position: absolute;
            width: 1.333333rem;
            height: 1.333333rem;
            opacity: 0;
        }

        .sc_img img {
            width: 1.333333rem;
            height: 1.333333rem
        }

        .gg_btn {
            margin-top: 4rem;
        }

        .sc_img .ns1 {
            width: 100%;
            height: 100%
        }
        .header{
            position: relative;
        }
        .g-right{
            position: absolute;
            right: .4rem;
            top: 0;
            font-size: .35rem;
        }
        .o_qbzh{
            margin-bottom: .8rem;
        }
        .sr_num{
            font-size: .4rem
        }
        .wszjxx {
            width: 100%;
            margin-top: 1rem;
            text-align: center;
        }
        .wszjxx button {
            width: 90%;
            height: 1rem;
            border-radius: .1rem;
            background: #03BE87;
            font-size: .4rem;
            line-height: 1rem;
            border: 1px solid #03be87;
            color: #fff;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="header">
            <span>锁仓</span>
            <a href="javascript:history.go(-1)" class="return"></a>
            <div class="g-right" onclick="location.href='/index/shop/lock_record'">
                锁仓记录
            </div>
        </div>
        <div class="ws_small">
            <div>节点锁仓数量</div>
            <div class="o_qbzh">
                <input id='trigger1' class="sr_num" style="border:none;background: transparent;height: .8rem;margin:0;padding:0"
                    type="number" placeholder="请输入锁仓数量" readonly>
            </div>
            <div>杠杆倍数</div>
            <div class="o_qbzh">
                <input id='ggbs' class="sr_num" style="border:none;background: transparent;height: .8rem;margin:0;padding:0"
                    type="number" placeholder="" readonly>
            </div>
            <div>节点分润‰</div>
            <div class="o_qbzh">
                <input class="sr_num jiedian" style="border:none;background: transparent;height: .8rem;margin:0;padding:0"
                    type="number" placeholder="" readonly>
            </div>
            <div>释放比例</div>
            <div class="o_qbzh">
                <input class="sr_num bili" style="border:none;background: transparent;height: .8rem;margin:0;padding:0"
                    type="text" placeholder="" readonly>
            </div>
            <div>密码</div>
            <div class="o_qbzh">
                <input class="sr_num pass" style="border:none;background: transparent;height: .8rem;margin:0;padding:0"
                    type="number" placeholder="请输入密码">
            </div>
        </div>
        <div class="wszjxx" style="margin-bottom: .4rem" id="dh"><button class="tjssb" type="submit">确定</button></div>
    </div>
    <script>
        $(function () {
            $.ajax({
            type: "POST",
            url:"/index/asset/locklist",
            data:{},
            dataType: "jsonp", 
            success: function (res) {
                var weekdayArr=[];
                for(var i=0;i<res.info.length;i++){
                    weekdayArr.push(res.info[i].number);
                }
                var mobileSelect1 = new MobileSelect({
                        trigger: '#trigger1',
                        title: '请选择数量',
                        wheels: [
                                    {data: weekdayArr}
                        ],
                        
                        transitionEnd: function (indexArr, data) {

                        },
                        callback: function (indexArr, data) {
                            for(var i=0;i<res.info.length;i++){
                                $('.selectContainer li').eq(i).data('type',res.info[i].id);  
                            }
                           
                            var num1=indexArr[0];
                            $('.jiedian').val(res.info[num1].xfee);
                            $('#ggbs').val(res.info[num1].multiple);
                            $('.bili').val(res.info[num1].released+'‰/天');
                            var id=$('.selectContainer li').eq(indexArr[0]).data('type');
                            console.log(id);
                            $('#trigger1').val(data[0])
                            var tpl='<img src="/zc/img/suoc.png" alt="">'+
                            '<span>锁仓</span>'
                            $('.zsc').html(tpl);
                            $('.tjssb').click(function (e) { 
                                
                                var trad_password=$('.pass').val();
                                if(!id){
                                    return  mui.toast('请选择数量');
                                }
                                if(!trad_password){
                                    return  mui.toast('交易密码不能为空');
                                }
                                $.ajax({
                                    type: "POST",
                                    url: "/index/asset/lockbouns",
                                    data: {id:id,trad_password:trad_password},
                                    dataType: "jsonp",
                                    success: function (res) {
                                        if(res.code==0){
                                            mui.toast(res.msg);
                                            setTimeout(function(){
                                                history.back(-1);
                                            }, 1500) 
                                        }else{
                                            setTimeout(function(){
                                                mui.toast(res.msg);
                                            }, 1500)  
                                        }
                                    }
                                });
                            });
                            
                        }
                    });
            }
        })
        
        });
    </script>
</body>

</html>